package abg.core.mapper;

import abg.core.domain.db.SysFile;
import com.mybatisflex.core.query.QueryWrapper;

import static abg.core.domain.db.table.SysFileTableDef.SYS_FILE;

public interface SysFileMapper extends ZBMapper<SysFile> {


    default SysFile getOneUriByMd5(String md5) {
        QueryWrapper queryWrapper = QueryWrapper.create().select("uri").and(SYS_FILE.MD5.eq(md5)).limit(1);
        return selectOneByQuery(queryWrapper);
    }

    default SysFile getOneByMd5(String md5) {
        QueryWrapper queryWrapper = QueryWrapper.create().and(SYS_FILE.MD5.eq(md5)).limit(1);
        return selectOneByQuery(queryWrapper);
    }
}